import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service


def she():
    q = Options()
    q.add_argument('--no-sandbox')
    q.add_experimental_option('detach', True)
    d = webdriver.Chrome(service=Service('chromedriver.exe'), options=q)
    return d


def open_url(d, url):
    d.get(url)
    # d.maximize_window()
    time.sleep(5)
    d.minimize_window()
    time.sleep(2)


if __name__ == '__main__':
    d = she()
    open_url(d, 'https://www.baidu.com')
    d.quit()
